package mfuny.ggongal.admin;

import mfuny.ggongal.admin.faq.FaqDao;
import mfuny.ggongal.admin.faq.FaqService;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class FaqController {
    ModelAndView mav;
    FaqService fs;
    
    public FaqController() throws Exception{
        mav = new ModelAndView();
        fs = new FaqService();
    }
    
    @RequestMapping("/regFaqForm.ga")
    public ModelAndView regFaqForm(){
        return fs.regFaqForm();
    }
    @RequestMapping("/regFaq")
    public ModelAndView regFaq(@ModelAttribute FaqDao faqDao){
        System.out.println("데이터 처리 실행-FaqController거침");
        return fs.regFaq(faqDao);
    }
    @RequestMapping("/readFaqForApp")
    public ModelAndView regFaqForApp(int num){
        return fs.readFaqForApp(num);
    }
}
